[Attachment(s) from Tom Kerekes included below]
Hi Steve,
Its ok to use the same Thread. We are just creating one big loop that does all the required tasks for your system.
But you pasted the stuff in completely the wrong place
for (;;) // loop forever
{
stuff...
stuff...
stuff...
stuff...
stuff...
stuff...
stuff...
stuff...
}
The main forever loop that does all your "stuff" looks like above. Everything within
the ope and closed curly brackets get executed repeatedly forever. If you want to add a new task like watch a button or whatever it should be add to the list of "stuff" between the curly brackets. I've tried to fix it up in the attached file. Please take a moment to look it over and see if you can identify the start and end of the loop.
HTH
Regards
TK
Group: DynoMotion |
Message: 8918 |
From: Tom Kerekes |
Date: 1/22/2014 |
Subject: Re: Init file |
Hi Steve,
Yes you found the Start and End of the Loop. I guess you are just showing a fragment of code but you included extra miss-matched curly brackets. And also improper indentation. Indentation (spaces or tabs) actually has no effect on the code execution but hurts my eyes to look at. Here is some properly indented code (sometimes email messes up tabs so I hope this comes through correctly). Notice how it is easy to see how every open curly bracket matches with
a closed curly bracket on the same column. It makes it easy to see everything in a "block" of code. And you can see what is nested inside what.
if(A)
{
if(B)
{
XXXXXX
XXXXXX
}
if(C)
{
XXXXXX
XXXXXX
}
}
Regards TK | |